//引入路由对象
import { createRouter, createWebHistory, createWebHashHistory, createMemoryHistory, RouteRecordRaw } from 'vue-router'

//路由数组的类型 RouteRecordRaw
// 定义一些路由
// 每个路由都需要映射到一个组件。
const routes: Array<RouteRecordRaw> = [{
    path: '/',
    name: 'index',
    component: () => import('@/views/user/test.vue'),
    children: [
        // {
        //     path:'home',
        //     name:'home',
        //     component:()=> import('@/views/index/home/index.vue')
        // },
        // {
        //     path:'func',
        //     name:'func',
        //     component:()=> import('@/views/index/func/index.vue')
        // },
        // {
        //     path:'my',
        //     name:'my',
        //     component:()=> import('@/views/index/my/index.vue')
        // },

    ]
}, {
    path: '/preview',
    name: 'preview',
    component: () => import('@/views/user/preview.vue')
},{
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
}, {
    path: '/user',
    name: 'user',
    component: () => import('@/views/user/index.vue')
},
{
    path: '/notice_success',
    name: 'notice_success',
    component: () => import('@/views/user/success.vue')
},
{
    path: '/notice_successover',
    name: 'notice_successover',
    component: () => import('@/views/user/successover.vue')
},
{
    path: '/notice_fail',
    name: 'notice_fail',
    component: () => import('@/views/user/fail.vue')
},
{
    path: '/qiwei',
    name: 'qiwei',
    component: () => import('@/views/user/qiwei_view.vue')
},
    //{
    //     path: '/notice/details',
    //     name: 'notice_details',
    //     component: () => import('@/views/index/notice/details.vue')
    // },

]

//vue2 mode history vue3 createWebHistory
//vue2 mode  hash  vue3  createWebHashHistory
//vue2 mode abstact vue3  createMemoryHistory

const router = createRouter({
    // history: createWebHistory(),
    history: createWebHashHistory(),
    routes
})

//导出router
export default router